home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / programming / misc / xref_v1.1.lha / XRef / Tools / lib / xrefsupport.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-01-26  |  4.1 KB  |  183 lines

  1. /*
  2. ** $PROJECT: xrefsupport.lib
  3. **
  4. ** $VER: xrefsupport.h 1.2 (09.09.94) 
  5. **
  6. ** by
  7. **
  8. ** Stefan Ruppert , Windthorststraße 5 , 65439 Flörsheim , GERMANY
  9. **
  10. ** (C) Copyright 1994
  11. ** All Rights Reserved !
  12. **
  13. ** $HISTORY:
  14. **
  15. ** 09.09.94 : 001.002 :  ScanWindow added
  16. ** 04.09.94 : 001.001 :  initial
  17. */
  18.  
  19. /* ------------------------------- define's ------------------------------- */
  20.  
  21. #define BUFFER_SIZE        1024
  22.  
  23. enum {
  24.    FTYPE_UNKNOWN,
  25.    FTYPE_HEADER,           /* c header file */
  26.    FTYPE_AUTODOC,          /* commodore autodoc file format */
  27.    FTYPE_DOC,              /* normal ascii document */
  28.    FTYPE_AMIGAGUIDE,       /* commodore amigaguide format */
  29.    FTYPE_MAN,              /* unix manual page format */
  30.    FTYPE_INFO,             /* GNU InfoView file format (not implemented yet!) */
  31.    };
  32.  
  33. #define SPM_FILE           1
  34. #define SPM_DIR            2
  35.  
  36. #define TIME_USED          0
  37. #define TIME_EXPECTED      1
  38. #define TIME_LEFT          2
  39.  
  40. /* ----------------------------- structure's ------------------------------ */
  41.  
  42. struct Buffer
  43. {
  44.    STRPTR b_Ptr;
  45.    UBYTE b_Buffer[BUFFER_SIZE];
  46. };
  47.  
  48. struct SaveDefIcon
  49. {
  50.    STRPTR sdi_DefaultIcon;
  51.    STRPTR sdi_DefaultTool;
  52.    STRPTR *sdi_ToolTypes;
  53.    struct Image *sdi_Image;
  54. };
  55.  
  56. /* scan_pattern() function callback hook message see SPM_#? */
  57.  
  58. struct spMsg
  59. {
  60.    ULONG Msg;
  61.    struct FileInfoBlock *Fib;
  62.    BPTR FHandle;
  63.    STRPTR Path;
  64.    STRPTR RealPath;
  65. };
  66.  
  67. struct ScanStat
  68. {
  69.    ULONG ss_Files;
  70.    ULONG ss_Directories;
  71.    ULONG ss_TotalFileSize;
  72.  
  73.    ULONG ss_ActFiles;
  74.    ULONG ss_ActDirectories;
  75.    ULONG ss_ActTotalFileSize;
  76. };
  77.  
  78. struct Gauge
  79. {
  80.    struct RastPort *RPort;
  81.    UWORD Left;
  82.    UWORD Top;
  83.    UWORD Right;
  84.    UWORD Bottom;
  85.    UWORD FillPen;
  86.    UWORD LastPixel;
  87. };
  88.  
  89. struct ScanWindow
  90. {
  91.    struct Window *sw_Window;
  92.    struct TextAttr sw_TextAttr;
  93.    struct TextFont *sw_TextFont;
  94.  
  95.    UWORD sw_YTop;
  96.    UWORD sw_YStep;
  97.    UWORD sw_XTop;
  98.    UWORD sw_XMax;
  99.    UWORD sw_XTime;
  100.    UWORD sw_YTime;
  101.    UWORD sw_XTimeMax;
  102.  
  103.    UWORD sw_TextPen;
  104.    UWORD sw_BackPen;
  105.  
  106.    struct Gauge sw_Total;
  107.    struct Gauge sw_Actual;
  108.  
  109.    UBYTE sw_FontName[32];
  110. };
  111.  
  112. struct TimeCalc
  113. {
  114.    ULONG tc_Secs[3];
  115.    ULONG tc_BeginSec;
  116.    ULONG tc_BeginMic;
  117.  
  118.    ULONG tc_LastSec;
  119.    UWORD tc_TimeCalled;
  120.    UWORD tc_Update;
  121. };
  122.  
  123. /* --------------------------- extern variables --------------------------- */
  124.  
  125. extern const STRPTR ftype[];
  126.  
  127. /* ------------------------- function prototypes -------------------------- */
  128.  
  129. /* chechsuffix.c */
  130. BOOL checksuffix(STRPTR file,STRPTR suffix);
  131.  
  132. /* checkentrytype.c */
  133. ULONG checkentrytype(STRPTR name);
  134.  
  135. /* getfiletype.c */
  136. ULONG getfiletype(BPTR fh,STRPTR file);
  137.  
  138. /* insertbyname.c */
  139. void insertbyname(struct List *list,struct Node *node);
  140.  
  141. /* insertbyiname.c */
  142. void insertbyiname(struct List *list,struct Node *node);
  143.  
  144. /* saveicon.c */
  145. void saveicon(STRPTR file,struct SaveDefIcon *def_icon);
  146.  
  147. /* showerror.c */
  148. void showerror(STRPTR prgname,STRPTR header,LONG error);
  149.  
  150. /* writebuffer.c */
  151. void mysprintf(struct Buffer *buf,STRPTR fmt,APTR arg,...);
  152.  
  153. /* calctextwidth.c */
  154. UWORD calctextwidth(struct RastPort *rp,STRPTR *textarray);
  155.  
  156. /* convertsuffix.c */
  157. void convertsuffix(ULONG filetype,STRPTR file);
  158.  
  159. /* getamigaguidenode.c */
  160. void getamigaguidenode(STRPTR *nameptr,STRPTR *titleptr);
  161.  
  162. /* getmaxdigitwidth.c */
  163. UWORD getmaxdigitwidth(struct RastPort *rp);
  164.  
  165. /* gauge.c */
  166. void draw_gaugeinit(struct Window *win,struct Gauge *gauge,UBYTE shinepen,UBYTE shadowpen);
  167. void draw_gauge(struct Gauge *gauge,ULONG actual,ULONG maximal);
  168.  
  169. /* scanpattern.c */
  170. LONG scan_patterns(STRPTR *patterns,struct Hook *callback,APTR userdata);
  171. void getscanstat(STRPTR *patterns,struct ScanStat *stat);
  172.  
  173. /* scanwindow.c */
  174. BOOL open_scanwindow(struct ScanWindow *swin,STRPTR *texts,STRPTR title,UWORD winwidth);
  175. void close_scanwindow(struct ScanWindow *swin,BOOL abort);
  176. void draw_scanwindowstatus(struct ScanWindow *swin,STRPTR string);
  177. void draw_scanwindowtext(struct ScanWindow *swin,ULONG num,STRPTR string);
  178. void draw_scanwindowtime(struct ScanWindow *swin,ULONG *secs);
  179.  
  180. /* timecalc.c */
  181. void time_init(struct TimeCalc *time,ULONG update);
  182. void time_calc(struct TimeCalc *time,ULONG actual,ULONG total);
  183.